<template>
  <div class="custom-table">
    <div class="custom-table-title">
      {{ $store.getters.schoolName }}周工作计划表
    </div>
    <div class="custom-table-header">
      <div><span>班级：</span>{{ dataListLeft.className }}</div>
      <div class="borderL">
        <span>周次：</span>{{ dataListLeft.weekNumber }}
      </div>
      <div>
        <span>日期：</span>{{ transform(dataListLeft.startTime) }}-{{
          transform(dataListLeft.endTime)
        }}
      </div>
    </div>
    <el-table class="custom-table-main" :data="tableData" border style="width: 100%">
      <el-table-column label="星期" align="right" width="150">
        <el-table-column
          prop="date"
          label="内容"
          align="center"
          header-align="left"
          width="120"
        >
        </el-table-column>
      </el-table-column>
      <el-table-column prop="morningActivities" label="上午" align="center">
        <template slot-scope="scope">
          <div class="morin-main">
            <div
              class="main-item"
              v-for="activity in scope.row.morningActivities"
              :key="activity.id"
              :title="activity.activityTarget?'课程目标：'+activity.activityTarget:'课程目标：暂无'"
            >
              <div style="color:#409EFF">{{ activity.activityType }}</div>
              <div>{{ activity.activityName }}</div>
              <!-- <div class="item-objective" :title="activity.activityTarget">{{ activity.activityTarget }}</div> -->
            </div>
          </div>
        </template>
      </el-table-column>
      <el-table-column prop="afternoonActivities" label="下午" align="center" >
       <template slot-scope="scope">
          <div class="morin-main">
            <div
              class="main-item"
              v-for="activity in scope.row.afternoonActivities"
              :key="activity.id"
              :title="activity.activityTarget?'课程目标：'+activity.activityTarget:'课程目标：暂无'"
            >
              <div style="color:#409EFF">{{ activity.activityType }}</div>
              <div>{{ activity.activityName }}</div>
              <!-- <div class="item-objective" :title="activity.activityTarget">{{ activity.activityTarget }}</div> -->
            </div>
          </div>
        </template>
      </el-table-column>
    </el-table>

    <div class="custom-table-bott">
      <div class="borderBt">
        <span class="borderR">本周教育重点</span
        ><span class="flex1">{{ dataListLeft.educationFocus }}</span>
      </div>
      <div class="borderBt">
        <span class="borderR">本周保育重点</span
        ><span class="flex1">{{ dataListLeft.conservationFocus }}</span>
      </div>
      <div class="bott">
        <span class="borderR">本周家长工作</span
        ><span class="flex1">{{ dataListLeft.parentWork }}</span>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    tableData: {
      type: Array,
      default: [],
    },
    dataListLeft: {
      type: Object,
      default: {},
    },
    dayList: {
      type: Array,
      default: ["上午", "下午"],
    },
  },
  data() {
    return {
      morningActivities: {},
      afternoonActivities: {},
    };
  },
  created() {
  },
  methods: {
    transform(val) {
      console.log('val',val);
      let date = val.split(" "),
      year = date[0];
      year = year.substring(year.indexOf("-") + 1, year.lenght);
      year = parseFloat(year.replace("-", "."));
      return year;
    },
  },
};
</script>
<style lang="scss" scoped>
html body table {height:100%}
.borderT {
  border-top: 1px solid #dfe6ec;
}
.borderL {
  border-left: 1px solid #dfe6ec;
}
.borderBt {
  display: flex;
  align-items: center;
  border-bottom: 1px solid #dfe6ec;
}
.bott {
  display: flex;
  align-items: center;
}
.borderR {
  width: 120px;
  // border-right: 1px solid #dfe6ec;
  text-align: center;
}
.flex1 {
  flex: 1;
  border-left: 1px solid #dfe6ec;
}
.custom-table {
  box-sizing: border-box;
  .custom-table-title {
    text-align: center;
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: 600;
  }
  .custom-table-header {
    height: 40px;
    display: flex;
    text-align: left;
    border: 1px solid #dfe6ec;
    border-bottom: none;
    div {
      padding-left: 10px;
      width: 33.33%;
      height: 40px;
      line-height: 40px;
    }
    div:last-child {
      flex: 1;
    }
  }
  .custom-table-bott {
    display: flex;
    flex-direction: column;
    border: 1px solid #dfe6ec;
    box-sizing: border-box;
    border-top: none;
    div {
      // height: 40px;
      // line-height: 40px;
      span {
        padding: 10px;
        // display: inline-block;
        // width: 120px;
        // margin-right: 10px;
        // text-align: center;
      }
    }
  }
}
::v-deep .el-table__row {
  td:first-child {
    text-align: center;
  }
}
::v-deep .tableBaseInfo {
  .hiddenClass {
    display: none !important;
  }
  .textAlignLeft {
    text-align: left !important;
  }
  .textCustomAlignLeft {
    text-align: left !important;
    font-weight: 700;
    color: #000;
  }
}
::v-deep .no-data .el-table__body-wrapper {
  display: none;
}
::v-deep .firstAppraisal .textAlignRight {
  text-align: right !important;
}
::v-deep .no-header.el-table--border {
  border-top: none !important;
}
::v-deep .no-header .el-table__header-wrapper {
  display: none;
}
::v-deep .no-header-only.el-table--border {
  border-top: none !important;
}
::v-deep .text-set {
  color: #000;
  font-weight: 700;
}
::v-deep .el-table::before {
  height: 0;
}
/* 如果单元格的padding */
.elChgTbeClmn .cell {
  padding: 0px !important;
}
.elHeadCon {
  height: 50px;
  position: relative;
}
.headerCon1 {
  position: absolute;
  left: 0;
  bottom: 0;
}
.headerCon2 {
  position: absolute;
  right: 0;
  top: 0;
}
.headerLine {
  width: 1px;
  height: 150px;
  transform: rotate(-68deg); /*这里需要自己调整，根据线的位置*/
  transform-origin: top;
  background-color: red;
}

.el-table thead.is-group th {
  background: none;
}
.el-table thead.is-group tr:first-of-type th:first-of-type {
  border-bottom: none;
}

/*::v-deep 这里主要的作用就是用来强制修改element默认的样式*/
::v-deep .el-table thead.is-group th {
  background: none;
  padding: 0px;
}

::v-deep .el-table thead.is-group tr:first-of-type th:first-of-type {
  border-bottom: none; /*中间的横线去掉*/
}

::v-deep .el-table thead.is-group tr:first-of-type th:first-of-type div.cell {
  text-align: right; /*上边文字靠右*/
}

::v-deep .el-table thead.is-group tr:last-of-type th:first-of-type div.cell {
  text-align: left; /*下边文字靠左*/
}
/*核心代码*/
::v-deep .el-table thead.is-group tr:first-of-type th:first-of-type:before {
  content: "";
  position: absolute;
  width: 1px;
  height: 100px; /*斜线的长度*/
  top: 0;
  left: 0;
  background-color: grey;
  opacity: 0.2;
  display: block;
  transform: rotate(-60deg); /*调整斜线的角度*/
  transform: rotate(-59deg); /*调整斜线的角度*/
  -webkit-transform-origin: top;
  transform-origin: top;
}

::v-deep .el-table thead.is-group tr:last-of-type th:first-of-type:before {
  content: "";
  position: absolute;
  width: 1px;
  height: 100px; /*斜线的长度*/
  bottom: 0;
  right: 0;
  background-color: grey;
  opacity: 0.2;
  display: block;
  transform: rotate(-60deg); /*调整斜线的角度*/
  transform: rotate(-60deg); /*调整斜线的角度*/
  -webkit-transform-origin: bottom;
  transform-origin: bottom;
}
::v-deep .el-table thead.is-group th {
  height: 27.4px;
}
.custom-table-main {
  ::v-deep .el-table__row {
    height: 70px;
  }
  ::v-deep .el-table th {
    height: 70px;
  }
}
::v-deep .el-table .el-table__header-wrapper th,
::v-deep .el-table .el-table__fixed-header-wrapper th{
  font-weight: 500;
}
::v-deep .el-table__row{
  td{
    height: 1px;
  }
  td:first-child{
    height: 100%;
    div{
      display: flex;
      align-items: center;
      justify-content: center;
    }
  }
}
::v-deep .el-table thead {
  height: 70px;
}
::v-deep .el-table__row {
  .cell {
    display: flex;
    width: 100%;
    height: 100%;
    .morning-activities {
      flex: 1;
    }
  }

}
.morin-main {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  .main-item{
    flex: 1;
    border-right: 1px solid #ccc;
    height:100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    .item-objective{}
  }
  .main-item:last-child{
    border-right: none;
  }
}
::v-deep.el-table .cell {
  // padding-left: 0;
  // padding-right: 0;
}
::v-deep .el-table--medium th,
::v-deep .el-table--medium td {
  padding: 0;
}
</style>
